package com.qinyi.common.ajax;

import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;

/**
 * @author wangan on 2019/6/4
 * @description
 */
public class CommonAjaxResult {
	private int code;
	private String msg;

	public CommonAjaxResult(int code, String msg) {
		this.code = code;
		this.msg = msg;
	}

	public CommonAjaxResult(AjaxCode code) {
		this.code = code.getCode();
		this.msg = code.getMsg();
	}

	public CommonAjaxResult(AjaxCode code, String msg) {
		this.code = code.getCode();
		this.msg = msg;
	}

	@Override
	public String toString() {
		return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE).append("code", code)
				.append("msg", msg).append("data", "").toString();
	}
}
